package org.elanfox.intellicommunity.biz.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author allan
 * @date 2019-10-12
 */
@Configuration
public class BizConfig {
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Bean("msgThreadPool")
    public ThreadPoolTaskExecutor msgThreadPool() {
        ThreadPoolTaskExecutor msgPool = new ThreadPoolTaskExecutor();
        msgPool.setCorePoolSize(5);

        return msgPool;
    }
}
